package com.jobson.model;

// Generated May 1, 2013 12:14:36 PM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name = "User", catalog = "JobsonTally")
public class User implements java.io.Serializable {

    /**
	 * 
	 */
    private static final long serialVersionUID = -3517024558635054992L;
    private Integer id;
    private String name;
    private String familName;
    private String userName;
    private String password;
    private String hint;
    private String createdBy;
    private Date createdOn;
    private boolean isDisabled;
    private boolean inSales;
    private String location;
    private int tableId;
    private Set<Address> addresses = new HashSet<Address>(0);
    private Set<PhoneNo> phoneNos = new HashSet<PhoneNo>(0);
    private Set<Address> addresses_1 = new HashSet<Address>(0);
    private Set<Customer> customersForModifiedBy = new HashSet<Customer>(0);
    private Set<Stock> stocksForModifiedBy = new HashSet<Stock>(0);
    private Set<Stock> stocksForModifiedBy_1 = new HashSet<Stock>(0);
    private Set<Stock> stocksForCreatedBy = new HashSet<Stock>(0);
    private Set<Customer> customersForCreatedby = new HashSet<Customer>(0);
    private Set<Customer> customersForCreatedby_1 = new HashSet<Customer>(0);
    private Set<Customer> customersForModifiedBy_1 = new HashSet<Customer>(0);
    private Set<Bank> banksForCreatedBy = new HashSet<Bank>(0);
    private Set<PhoneNo> phoneNos_1 = new HashSet<PhoneNo>(0);
    private Set<Bank> banksForModifiedBy = new HashSet<Bank>(0);
    private Set<Bank> banksForCreatedBy_1 = new HashSet<Bank>(0);
    private Set<Bank> banksForModifiedBy_1 = new HashSet<Bank>(0);
    private Set<Stock> stocksForCreatedBy_1 = new HashSet<Stock>(0);

    // Flag indicate if update has to be called for Customer Table table
    private boolean isUpdated = false;

    public void setIsUpdated(boolean aValue) {
        this.isUpdated = aValue;
    }

    @Transient
    public boolean getIsUpdated() {
        return isUpdated;
    }

    public User() {
        this.tableId = 12;
    }

    public User(String name, String userName, String password, boolean isDisabled, boolean inSales, int tableId) {
        this.name = name;
        this.userName = userName;
        this.password = password;
        this.isDisabled = isDisabled;
        this.inSales = inSales;
        this.tableId = tableId;
    }

    public User(String name, String familName, String userName, String password, String hint, String createdBy, Date createdOn, boolean isDisabled,
            boolean inSales, String location, int tableId, Set<Address> addresses, Set<PhoneNo> phoneNos, Set<Address> addresses_1,
            Set<Customer> customersForModifiedBy, Set<Stock> stocksForModifiedBy, Set<Stock> stocksForModifiedBy_1, Set<Stock> stocksForCreatedBy,
            Set<Customer> customersForCreatedby, Set<Customer> customersForCreatedby_1, Set<Customer> customersForModifiedBy_1,
            Set<Bank> banksForCreatedBy, Set<PhoneNo> phoneNos_1, Set<Bank> banksForModifiedBy, Set<Bank> banksForCreatedBy_1,
            Set<Bank> banksForModifiedBy_1, Set<Stock> stocksForCreatedBy_1) {
        this.name = name;
        this.familName = familName;
        this.userName = userName;
        this.password = password;
        this.hint = hint;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.isDisabled = isDisabled;
        this.inSales = inSales;
        this.location = location;
        this.tableId = tableId;
        this.addresses = addresses;
        this.phoneNos = phoneNos;
        this.addresses_1 = addresses_1;
        this.customersForModifiedBy = customersForModifiedBy;
        this.stocksForModifiedBy = stocksForModifiedBy;
        this.stocksForModifiedBy_1 = stocksForModifiedBy_1;
        this.stocksForCreatedBy = stocksForCreatedBy;
        this.customersForCreatedby = customersForCreatedby;
        this.customersForCreatedby_1 = customersForCreatedby_1;
        this.customersForModifiedBy_1 = customersForModifiedBy_1;
        this.banksForCreatedBy = banksForCreatedBy;
        this.phoneNos_1 = phoneNos_1;
        this.banksForModifiedBy = banksForModifiedBy;
        this.banksForCreatedBy_1 = banksForCreatedBy_1;
        this.banksForModifiedBy_1 = banksForModifiedBy_1;
        this.stocksForCreatedBy_1 = stocksForCreatedBy_1;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "Name", nullable = false, length = 65535)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "FamilName", length = 65535)
    public String getFamilName() {
        return this.familName;
    }

    public void setFamilName(String familName) {
        this.familName = familName;
    }

    @Column(name = "UserName", nullable = false, length = 65535)
    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Column(name = "Password", nullable = false, length = 65535)
    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "Hint", length = 65535)
    public String getHint() {
        return this.hint;
    }

    public void setHint(String hint) {
        this.hint = hint;
    }

    @Column(name = "CreatedBy", length = 65535)
    public String getCreatedBy() {
        return this.createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Temporal(TemporalType.DATE)
    @Column(name = "CreatedOn", length = 10)
    public Date getCreatedOn() {
        return this.createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    @Column(name = "IsDisabled", nullable = false)
    public boolean isDisabled() {
        return this.isDisabled;
    }

    public void setDisabled(boolean isDisabled) {
        this.isDisabled = isDisabled;
    }

    @Column(name = "InSales", nullable = false)
    public boolean isInSales() {
        return this.inSales;
    }

    public void setInSales(boolean inSales) {
        this.inSales = inSales;
    }

    @Column(name = "Location", length = 65535)
    public String getLocation() {
        return this.location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Column(name = "TableID", nullable = false)
    public int getTableId() {
        return this.tableId;
    }

    public void setTableId(int tableId) {
        this.tableId = tableId;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
    public Set<Address> getAddresses() {
        return this.addresses;
    }

    public void setAddresses(Set<Address> addresses) {
        this.addresses = addresses;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
    public Set<PhoneNo> getPhoneNos() {
        return this.phoneNos;
    }

    public void setPhoneNos(Set<PhoneNo> phoneNos) {
        this.phoneNos = phoneNos;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
    public Set<Address> getAddresses_1() {
        return this.addresses_1;
    }

    public void setAddresses_1(Set<Address> addresses_1) {
        this.addresses_1 = addresses_1;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByModifiedBy")
    public Set<Customer> getCustomersForModifiedBy() {
        return this.customersForModifiedBy;
    }

    public void setCustomersForModifiedBy(Set<Customer> customersForModifiedBy) {
        this.customersForModifiedBy = customersForModifiedBy;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByModifiedBy")
    public Set<Stock> getStocksForModifiedBy() {
        return this.stocksForModifiedBy;
    }

    public void setStocksForModifiedBy(Set<Stock> stocksForModifiedBy) {
        this.stocksForModifiedBy = stocksForModifiedBy;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByModifiedBy")
    public Set<Stock> getStocksForModifiedBy_1() {
        return this.stocksForModifiedBy_1;
    }

    public void setStocksForModifiedBy_1(Set<Stock> stocksForModifiedBy_1) {
        this.stocksForModifiedBy_1 = stocksForModifiedBy_1;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByCreatedBy")
    public Set<Stock> getStocksForCreatedBy() {
        return this.stocksForCreatedBy;
    }

    public void setStocksForCreatedBy(Set<Stock> stocksForCreatedBy) {
        this.stocksForCreatedBy = stocksForCreatedBy;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByCreatedby")
    public Set<Customer> getCustomersForCreatedby() {
        return this.customersForCreatedby;
    }

    public void setCustomersForCreatedby(Set<Customer> customersForCreatedby) {
        this.customersForCreatedby = customersForCreatedby;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByCreatedby")
    public Set<Customer> getCustomersForCreatedby_1() {
        return this.customersForCreatedby_1;
    }

    public void setCustomersForCreatedby_1(Set<Customer> customersForCreatedby_1) {
        this.customersForCreatedby_1 = customersForCreatedby_1;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByModifiedBy")
    public Set<Customer> getCustomersForModifiedBy_1() {
        return this.customersForModifiedBy_1;
    }

    public void setCustomersForModifiedBy_1(Set<Customer> customersForModifiedBy_1) {
        this.customersForModifiedBy_1 = customersForModifiedBy_1;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByCreatedBy")
    public Set<Bank> getBanksForCreatedBy() {
        return this.banksForCreatedBy;
    }

    public void setBanksForCreatedBy(Set<Bank> banksForCreatedBy) {
        this.banksForCreatedBy = banksForCreatedBy;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
    public Set<PhoneNo> getPhoneNos_1() {
        return this.phoneNos_1;
    }

    public void setPhoneNos_1(Set<PhoneNo> phoneNos_1) {
        this.phoneNos_1 = phoneNos_1;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByModifiedBy")
    public Set<Bank> getBanksForModifiedBy() {
        return this.banksForModifiedBy;
    }

    public void setBanksForModifiedBy(Set<Bank> banksForModifiedBy) {
        this.banksForModifiedBy = banksForModifiedBy;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByCreatedBy")
    public Set<Bank> getBanksForCreatedBy_1() {
        return this.banksForCreatedBy_1;
    }

    public void setBanksForCreatedBy_1(Set<Bank> banksForCreatedBy_1) {
        this.banksForCreatedBy_1 = banksForCreatedBy_1;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByModifiedBy")
    public Set<Bank> getBanksForModifiedBy_1() {
        return this.banksForModifiedBy_1;
    }

    public void setBanksForModifiedBy_1(Set<Bank> banksForModifiedBy_1) {
        this.banksForModifiedBy_1 = banksForModifiedBy_1;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByCreatedBy")
    public Set<Stock> getStocksForCreatedBy_1() {
        return this.stocksForCreatedBy_1;
    }

    public void setStocksForCreatedBy_1(Set<Stock> stocksForCreatedBy_1) {
        this.stocksForCreatedBy_1 = stocksForCreatedBy_1;
    }

}
